//
//  PreferenceCollectionViewCell.swift
//  OnceNectar
//
//  Created by 法正磊 on 2018/2/28.
//  Copyright © 2018年 com.inwhoop. All rights reserved.
//

import UIKit
import SwiftyJSON

class PreferenceCollectionViewCell: UICollectionViewCell {

    @IBOutlet weak var title: UILabel!
    @IBOutlet weak var showImageView: UIImageView!
    @IBOutlet weak var selectImageView: UIImageView!
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    func showData(tree: treeModel) {
        self.title.text = tree.text
//        showImageView.image = UIImage(named: imageName)
        
        showImageView.sd_setImage(with: appendUrl(suffix: tree.icon!), completed: nil)
        if tree.selected == "1" {
          
            selectImageView.isHighlighted = true
        }else{
            selectImageView.isHighlighted = false
        }
        
    }

     func showData1(isSelect: Bool, imageName: String, title: String) {
           self.title.text = title
        
                //        showImageView.image = UIImage(named: imageName)
                
                let url:URL = URL(string: "\(BaseURL)\(imageName)")!
                showImageView.sd_setImage(with: url as URL, completed: nil)
                 selectImageView.isHighlighted = isSelect
           
        }

        
}
